//
//  ViewController.m
//  创建动画01
//
//  Created by KL on 17/3/16.
//  Copyright © 2017年 KM. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@property(weak,nonatomic)CALayer *maLayer;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    CALayer *mylayer = [CALayer layer];
    [self.view.layer addSublayer:mylayer];
    self.maLayer = mylayer;
    
    //设置边框颜色
//    [mylayer setBounds:CGRectMake(30, 30, 200, 200)];
//    [mylayer setBackgroundColor:[UIColor orangeColor].CGColor];
    
    //设置中心点
    [mylayer setPosition:CGPointMake(20, 30)];
    //设置内容
//    UIImage *image = [UIImage imageNamed:@"th"];
//    [mylayer setContents:(id)image.CGImage];
    
    [mylayer setAnchorPoint:CGPointMake(0.3, 0.4)];
    [mylayer setTransform:CATransform3DMakeRotation(M_PI*2/7, 0, 0, 1)];
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
